﻿@model IEnumerable<INSE6260.OnlineBanking.Model.Transaction.TransactioHistory>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"> </script>
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        $('#StartDate').datepicker(({ dateFormat: '@Html.ConvertDateFormat()' }));
        $('#EndDate').datepicker(({ dateFormat:   '@Html.ConvertDateFormat()' }));
    });
</script>
@{
    ViewBag.Title = "Transaction History";
}
<div>
    @using (Ajax.BeginForm("ShowHistory", "TransactionHistory", new AjaxOptions
                                                                              {
                                                                                  UpdateTargetId = "HistoryList",
                                                                                  InsertionMode = InsertionMode.Replace,
                                                                                  HttpMethod = "GET"
                                                                              }))
    {
        
        <fieldset>
            <legend>Transaction History</legend>
            <input name="accountId1" value="@ViewBag.AccountId" type="hidden" />
            
            <div class="editor-label">
                Account:
            </div>
            <div class="editor-field">
                @Html.DropDownList("accountId", (SelectList)ViewBag.Accounts, new { value = @ViewBag.AccountId })
                
            </div>
            <div class="editor-label">
                From:
            </div>
            <div class="editor-field">
                <input id="StartDate" name="StartDate" value="@ViewBag.FromDate"/>
                
            </div>
            <div class="editor-label">
                To:
            </div>
            <div class="editor-field">
                <input id="EndDate" name="EndDate" value="@ViewBag.ToDate"/>
               
               
            </div>
            <div class="editor-field">
            <input type="submit" value="Show Transaction History" />
            </div>
        </fieldset>
    }
</div>

<div id="HistoryList">
    @{
        Html.RenderPartial("TransactionHistoryList",Model);
    }
</div>
